<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>计算n的阶乘</title>
	</head>
	<body>
		<script>
			let n = +prompt('请输入要计算数的阶乘',0);
			let result = 1;
			
			while( n >= 1){
				result *= n ;//  result = result*n	
				n--;
			}
			console.log(result);
		</script>
	</body>
</html>